@(signupForm: Form[User])

@import helper._
@import helper.twitterBootstrap._

@title = {
    Sign Up <small><a href="@routes.SignUp.editForm">Or edit an existing user</a></small>
}

@main(title, nav = "signup") { 
    @helper.form(action = routes.SignUp.submit) {  
        <fieldset>
            <legend>Informacoes Cadastro</legend>
            @inputText(
                signupForm("username"), 
                '_label -> "Username", 
                '_help -> "Escolha um username valido.",
                '_error -> signupForm.globalError
            )
            
            @inputText(
                signupForm("email"), '_label -> "Email",
                '_help -> "Digite um email valido."
            )
            
            @inputPassword(
                signupForm("password.main"), 
                '_label -> "Password",
                '_help -> "O password deve ter pelo menos 6 caracteres. "
            )
            
            @inputPassword(
                signupForm("password.confirm"), 
                '_label -> "Repita o password",
                '_help -> "Repita o password novamente.",
                '_error -> signupForm.error("password")
            )
            
        </fieldset>    
        <fieldset>  
            <legend>Informacoes Complementares</legend>
            @select(
                signupForm("profile.country"), 
                options = options(Countries.list),
                '_default -> "--- Escolha uma cidade ---",
                '_label -> "Cidade",
                '_error -> signupForm("profile.country").error.map(_.withMessage("Please select your country"))
            )
            
            @textarea(
                signupForm("profile.address"), 
                '_label -> "Endereco", 'cols -> 50
            )
            
            @inputText(
                signupForm("profile.age"), 
                '_label -> "Idade", 'class -> "mini",
                '_showConstraints -> false
            )
              
        </fieldset>
        <fieldset>   
            @checkbox(
                signupForm("accept"), 
                '_label -> None, '_text -> "Concorda com os Termos e condicoes",
                '_showConstraints -> false
            )
            
        </fieldset>
        <div class="actions">
            <input type="submit" class="btn primary" value="Cadastrar">
            <a href="@routes.Application.index" class="btn">Cancelar</a>
        </div>   
    } 
}